<template>
  <div class="hello">
    <el-button type="primary" @click="switchChinese()">切换中文</el-button>
    <el-button type="primary" @click="switchEnlish()">切换英文</el-button>
    <p>{{$t('message.hello')}}</p> 
    <p>{{$t('message.msg')}}</p>
  </div>
</template>

<script>
export default {
  name: 'changLang',
  data () {
    return {
      
    }
  },
  methods: {
    switchChinese(){
      this.$i18n.locale = 'cn'; 
    },
    switchEnlish(){
      this.$i18n.locale = 'en'; 
    }

  }
}
</script>